#
from typing import Dict
import numpy as np
import torch

class NlbfConfig(object):
    def __init__(self):
        self.name = 'apps.wfs.nlbf_config.NlbfConfig'
    
    device = 'cuda' if torch.cuda.is_available() else 'cpu'
    f = 77E9 # 频率
    c = 3E8
    lambda_ = c / f # 波长
    sample_rate = 2 * f # 采样率
    K = 1000       # 快照数
    B = 300.0E6 # 带宽
    T = 1.0 / f # 周期
    slope = B / T # 线性调频信号的斜率
    delta_t = 1 / sample_rate
    times = np.arange(0, K, 1)*delta_t # 时间点序列
    rank = 3 # 2次多项式
    layers = 3 # 3层网络
    # 波束形成
    theta_min, theta_max, theta_step = -90, 90, 0.1
    thetas = np.arange(theta_min, theta_max, theta_step).reshape([1, -1])
    theta = 0.0 # 扫描角度
    thetas_rad = thetas / 180 * np.pi
    theta_rad = theta / 180 * np.pi
    #
    SSL_db = -30 # 旁瓣水平，单位：dB
    SSL = 10 ** (SSL_db / 10)

    N = 8 # 天线数量
    d = np.array([lambda_/2.0]) * np.ones([N, 1]) # 天线距离（半波长）
    n = np.arange(0, N, 1).reshape([-1, 1]) # 天线索引号
    # 算法训练参数
    X_fn = './work/wfs/X_nlbf.pt'
    y_fn = './work/wfs/y_nlbf.pt'